-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  local lazyrepo = "https://github.com/folke/lazy.nvim.git"
  local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
  if vim.v.shell_error ~= 0 then
    vim.api.nvim_echo({
      { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
      { out, "WarningMsg" },
      { "\nPress any key to exit..." },
    }, true, {})
    vim.fn.getchar()
    os.exit(1)
  end
end
vim.opt.rtp:prepend(lazypath)

-- SETUP LAZY

require("lazy").setup({

	-- ПЛАГИНЫ
	'nvim-telescope/telescope.nvim', tag = '0.1.8',
	'nvim-lua/plenary.nvim' ,
	'nvim-lua/plenary.nvim' , -- For Telescope plugin
	'neovim/nvim-lspconfig' ,-- LSP
	'hrsh7th/nvim-cmp' , -- Autocomplete
	'hrsh7th/cmp-nvim-lsp' ,
	'saadparwaiz1/cmp_luasnip' ,
	'L3MON4D3/LuaSnip' ,-- Сниппеты
	'nvim-treesitter/nvim-treesitter' , -- Подсветка синтаксиса
	'nvim-telescope/telescope.nvim' ,
	'nvim-telescope/telescope-fzf-native.nvim' ,
	'Pocco81/auto-save.nvim' , -- Автосохранение
	'jose-elias-alvarez/null-ls.nvim' , -- Форматирование и линтинг
	'nvim-neo-tree/neo-tree.nvim',branch = 'v3.x',
    "nvim-lua/plenary.nvim",
    "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
   	"MunifTanjim/nui.nvim",
	"ibhagwan/fzf-lua",
	"morhetz/gruvbox",
    "catppuccin/nvim",
    "terrortylor/nvim-comment",
    'nvim-lualine/lualine.nvim',
    'linrongbin16/lsp-progress.nvim',
    "windwp/nvim-autopairs",
    "akinsho/bufferline.nvim",
    "akinsho/toggleterm.nvim",
    "williamboman/mason.nvim",
    "iamcco/markdown-preview.nvim",
    cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
    ft = { "markdown" },
    build = function() vim.fn["mkdp#util#install"]() end,
      install = { colorscheme = { "gruvbox" } },
  -- automatically check for plugin updates
  checker = { enabled = true },

})
